<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>title</title>
    <link rel="stylesheet" href="../css/swiper.min.css">
    <link rel="stylesheet" href="../css/swiper.css">
    <script src="../script/swiper.min.js"></script>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <script type="text/javascript" src="http://libs.baidu.com/jquery/1.8.0/jquery.min.js" ></script>
<script type="text/javascript">
 $(document).ready(function() {


            $(".buy").click(function() {
                $(".no_all").show();

            })
           $(".no_foot").click(function() {
                // var index = $(this).index();
                $(".no_all").hide();

            })
            $(".ullist li").click(function(){
              $(this).siblings().removeClass('li').end().addClass('li');
            })

            $(window).scroll(function(){
                var topp = $(document).scrollTop();
                if(topp > 128){
                   $('.ullist li').eq(1).addClass('li').siblings().removeClass('li');
                }
                if(topp < 128){
                  $('.ullist li').eq(0).addClass('li').siblings().removeClass('li');
                }
                if(topp == 215){
                  $('.ullist li').eq(2).addClass('li').siblings().removeClass('li');
                }


            })

        })
 // animated
</script>
    <style>
        body {
            padding-top: 1.5rem;
        }

        .header {
          z-index: 9999;
            width: 94%;
            height: 2.5rem;
            line-height: 2.5rem;
            padding: 0.5rem 0.8rem;
            text-align: center;
            background-color: #fff;
            position: fixed;
            top: 1.5rem;
        }

        .header_img {
            width: 8%;
            height: 58%;
            float: left;
            margin-top: 1.2rem;
        }

        .header_img img {
            width: 100%;
            height: 100%;
        }

        .header ul {
            width: 60%;
            height: 3rem;
            margin: 0.5rem 0rem 0rem 25%;
        }

        .header ul li {
            width: 20%;
            height: 3rem;
            margin: 0rem 0.5rem;
            line-height: 3rem;
            text-align: center;
            float: left;
        }

        .header ul li a {
            color: #ccc;
            font-size: 1.2rem;
        }

        .li {
            border-bottom: 0.2rem solid black;
        }

        .li a {
            color: black!important;
            font-weight: bold;
        }

        .img {
            width: 100%;
            height: 60%;
            margin-top: 4rem;
        }

        .img img {
            width: 100%;
            height: 100%;
        }

        .nav {
            width: 85%;
            height: 2.7rem;
            background-color: #40cccc;
            color: #fff;
            padding: 0.5rem 0rem 0.5rem 0.8rem;
            margin: 0.5rem auto;
            border-radius: 0.5rem;
        }
      .nav_hhh{
        width: 50%;
        height: 2.7rem;
      }
        .nav_left {
            width: 43%;
            height: 1.1rem;
            border: 1px solid #fff;
            line-height: 1.1rem;
            border-radius: 1rem;
            float: left;
        }

        .nav_left p {
            width: 80%;
            height: 1rem;
            padding-left: 1rem;
        }

        .left_img {
            width: 25%;
            height: 100%;
            float: left;
            background-color: #fff;
            border-bottom-left-radius: 0.5rem;
            border-top-left-radius: 0.5rem;
        }

        .left_img img {
            width: 100%;
            height: 100%;
        }

        .nav_right {
            width: 50%;
            font-size: 0.9rem;
            height: 2.5rem;
            padding-top: 1rem;

            /*line-height: 2.5rem;*/
            /*margin-left: 1rem;*/
        }

  .time{
    margin-left: 0.5rem;
  }
  .time_f{
    background-color: #fff;
    color: #40cccc;
    width: 1.2rem;
    height: 1rem;
  }
        .all {
            width: 100%;

            background-color: rgb(242, 242, 242, 0.5);
        }

        .text {
            width: 93%;
            height: 8rem;
            padding: 0.5rem 0.8rem 1rem 0.8rem;
            background-color: #fff;
        }

        .main {
            width: 100%;
            padding: 0.5rem 0rem;
            height: 35%;
            margin-top: 0.4rem;
            background-color: #fff;
        }
        .main_r{
          width: 50%;
          height: 4rem;
          margin-right: 1rem;
        }

        .main_top {
            width: 95%;
            height: 4rem;
            padding-left: 1rem;
            line-height: 3.5rem;
        }

        .fl {
            float: left;
        }

        .fr {
            float: right;
        }

        .main_imgs {
            width: 8%;
            height: 29%;
            margin-left: 0.2rem;
            margin-top: 0.2rem;

        }

        .main_imgs img {
            width: 100%;
            height: 100%;
        }

        .main_left {
            margin-top: 1rem;
        }

        .left_imgs {
            width: 35%;
            height: 50%;
            margin-right: 0.5rem;
        }

        .left_img img {
            width: 100%;
            height: 100%;
        }

        .ef {
            height: 2rem;
            line-height: 1.2rem;
        }

        .hello {
            width: 93%;
            padding: 0.5rem 0.8rem;
            height: 39%;
            margin-top: 0.4rem;
            background-color: #fff;
        }

        .hello_img {
            width: 45%;
            height: 100%;
        }

        .hello_img img {
            width: 100%;
            height: 100%;
        }
        .hello_imgs {
            width: 22%;
            height: 55%;
        }

        .hello_imgs img {
            width: 100%;
            height: 100%;
        }

        .hello_one {
            width: 100%;
            height: 5rem;
            line-height: 5rem;
            border-bottom: 0.1rem solid rgb(242, 242, 242, 0.5);
        }

        .hello_left {
          width: 35%;
          height: 3rem;
            margin-top: 1rem;
        }

        .hello_right {
            margin-top: 1.5rem;
            width: 55%;
            text-align: right;
        }

        .go {
            width: 40%;
            height: 2.5rem;
            background-color: #40cccc;
            border-radius: 1.5rem;
            color: #fff;
            text-align: center;
            line-height: 2.5rem;
            margin-left: 0.5rem;
        }

        .pin {
            width: 93%;
            padding: 0.5rem 0.8rem;
            height: 20%;
            margin-top: 0.4rem;
            background-color: #fff;
        }

        .pin_one {
            width: 100%;
            height: 3.5rem;
            line-height: 3.5rem;
            border-bottom: 0.1rem solid rgb(242, 242, 242, 0.5);
        }

        .pin_right {
          width: 50%;
      height: 4rem;
      margin-right: 1rem;
        }

        .pin_img {
            width: 30%;
            height: 10%;
            margin-top: 0.2rem;
        }

        .pin_img img {
            width: 100%;
            height: 100%;
        }

        .pin_rights {
            width:93%;
            padding: 0.5rem 0.8rem;
            height: 3.5rem;
            line-height: 3.5rem;
        }

        .pin_imgs {
            width: 7%;
            height: 46%;
            margin-top: 0.5rem;
            margin-right: 0.2rem;
        }

        .pin_imgs img {
            width: 100%;
            height: 100%;
        }
        .sai{
          width: 93%;
          padding: 0.5rem 0.8rem;
          height: 20%;
          margin-top: 0.4rem;
          background-color: #fff;
        }
        .sai h4{
          width: 90%;
          height: 2rem;
          line-height: 2rem;
          padding: 0.5rem;
          border-bottom: 0.1rem solid rgb(242, 242, 242, 0.5);
        }
        .sai_nav{
          width: 93%;
          padding: 0.5rem 0.8rem;
          height: 8rem;
          border-bottom: 0.1rem solid rgb(242, 242, 242, 0.5);
        }
        .sai_nav{
          width: 93%;
          padding: 0.5rem 0.8rem;
          height: 8rem;
          border-bottom: 0.1rem solid rgb(242, 242, 242, 0.5);
        }
        .sai_navs{
          height: 4.5rem;
        }
        .sai_n{
          width: 85%;
          height: 2.5rem;
          margin: 1rem auto;
          border: 1px solid #40cccc;
          color: #40cccc;
          text-align: center;
          line-height: 2.5rem;
        }
      .kc{
        width: 93%;
        padding: 0.5rem 0.8rem;
        height: 60%;
        margin-top: 0.4rem;
        background-color: #fff;
      }
      .kc h4{
        width: 90%;
        height: 2rem;
        line-height: 2rem;
        padding: 0.5rem 0rem;
        border-bottom: 0.1rem solid rgb(242, 242, 242, 0.5);
      }
      .kc_img{
        width: 100%;
        margin-bottom: 3rem;
      }
      .kc_img img{
        width: 100%;
        height: 100%;
      }
      .kc_p{
        width: 96%;
        line-height: 1.3rem;
        padding: 0.5rem 0.5rem;
        font-size: 1rem;
      }
      .footer{
        width: 100%;
        height: 3rem;
        line-height: 3rem;
        text-align: center;
        position: fixed;
        bottom: 0;
        left: 0;
        color: white;

        background-color: #40cccc;
        /*box-shadow: 10px 10px 20px 10px rgba(242,242,242,0.5);*/
      }
  .footer_left{
    width: 35%;
    display: flex;
    padding: 0.2rem 0.5rem 0rem 0rem;
    justify-content: space-between;
    margin-top: 0.7rem;
  }
  .footer_limg{
    width: 17%;
    height: 30%;
  }
  .footer_limg img{
    width: 100%;
    height: 100%;
  }
  .footer_right{
    width: 60%;
    height:3rem;
    display: flex;
    justify-content: space-between;
  }
  .right_l{
    background-color: #72dada;
    color: #fff;
    text-align: center;
    line-height: 1rem;
    font-size: 0.8rem;
    width: 48%;
    height: 2.4rem;
    border-radius: 0.5rem;
    padding-top: 0.6rem;
  }
  .right_r{
    background-color: #40cccc;
  }
  .no_all{
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 9;
    position: fixed;
      display: none;
      overflow: hidden;
  }
  .main_no{
    width:100%;
  height:70%;
  overflow: auto;
    background-color: #fff;
    z-index: 999;
    position: fixed;
    bottom: 0rem;
    border-top-left-radius: 1rem;
    border-top-right-radius:1rem;
  }
  .no_foot{
    width: 90%;
    height: 2.5rem;
    line-height: 2.5rem;
    background-color: #40cccc;
    /*margin: 0.2rem auto;*/
    color: #fff;
    text-align: center;
    border-radius: 1rem;
    letter-spacing:0.2rem;
    bottom: 0.2rem;
    left: 1rem;
    z-index: 999;
    /*margin-top: 1.5rem;*/
    position: fixed;

  }
  .no_top {
      width: 90%;
      /*height: 90%;*/
        padding-top: 1rem;
      margin: 0 auto 3rem;
  }

  .no_noe {
      width:90%;
      height: 6rem;
      margin-bottom: 0.8rem;
      border-radius: 0.5rem;
      /*margin: 0.8rem auto 1rem;*/
  }

  .no_img {
      width: 90%;
      height: 6rem;
      margin: 0 auto;
      position: absolute;
      /*padding: 1rem 0.8rem;*/
  }

  .no_img img {
      width: 100%;
      height: 100%;
  }

  .no_text {
      position: relative;
      top: 20%;
      z-index: 999;
      margin-left: 1.2rem;
      float: left;
      /*margin-top: 1rem;*/
  }

  .no_w {
      position: relative;
      margin-top: 2rem;
      left:5%;
      width: 22%;
      border-radius: 1rem;
      height: 2rem;
      line-height: 2rem;
      text-align: center;
      background-color: #40cccc;
      color: #fff;
      float: right;
  }
    </style>

</head>

<body>
  <!-- 隐藏 -->
<div class="no_all" style="height:100%;">
  <div class="main_no">
    <div class="no_top" id="curj">
        <!-- <div class="no_noe">
            <div class="no_img">
                <img src="../image/a19.png" alt="">
            </div>
            <div class="no_text">
                <p style="color:red;font-size:2rem;"><span style="font-size:0.9rem;">￥</span>500</p>
                <p style="color:#ccc;">英孚教育课程专业劵</p>

            </div>
            <div class="no_w">
                <p style="font-size:0.9rem">立即领取</p>
            </div>
        </div> -->

    </div>
    <div class="no_foot">
      完成
    </div>
  </div>
</div>
    <div class="header">
        <div class="header_img">
            <img src="../image/u6.png" alt="" onclick="closewin()">
        </div>
        <ul class="ullist">
            <li class="li"><a href="#kc" id="a">课程</a></li>
            <li><a href="#comment">评论</a></li>
            <li><a href="#content">详情</a></li>
        </ul>
        <div class="header_img fr" style="margin-top:-2.4rem;margin-right:0.5rem;">
            <img src="../image/u36.png" alt=""  width="2rem" height="3rem" id="sc" onclick="scs()">
        </div>
    </div>
    <div class="img" id="kc">
      <div class="swiper-container">

          <div class="swiper-wrapper" style="margin-top:0.5rem;height: 15rem;" id="img_list">
          <!-- <div class="swiper-slide">
            <video poster=""src="http://vfx.mtime.cn/Video/2019/02/04/mp4/190204084208765161.mp4" width="100%" height="100%" controls >



            </video>
          </div> -->

          </div>
      </div>
    </div>
    <!-- <div class="nav">
        <div class="nav_hhh fl">
          <div class="nav_left">
              <div class="left_img">
                  <img src="../image/u55.png" alt="">
              </div>
              <p>2人团</p>
          </div>
          <span style="font-weight:bold;margin-left:0.2rem;">￥5681.00</span>
          <p style="font-size:0.8rem;width:100%;margin-top:0.5rem;">单买价：￥7770.00</p>
        </div>
        <div class="nav_right fr">
            <p class="fl">限时购</p>
            <div class="time fl">
              <span class="time_f">00</span>
              <span>:</span>
              <span class="time_f">24</span>
              <span>:</span>
              <span class="time_f">50</span>
            </div>
          </div>
    </div> -->
    <div class="all">
        <div class="text">
            <h4 id="mec_name"></h4>
            <p style="color:#ccc;margin-top:0.5rem;font-size:1.1rem;" id="cur_name">-</p>
            <p style="color:#ccc;margin-top:0.5rem;font-size:1.1rem;" id="cur_type"></p>
            <p style="color:#ccc;margin-top:0.5rem; float:left">市场价：￥<span id="orig_price"></span></p>
            <p style="color:#40cccc;margin-top:0.5rem;font-size:1.5rem;float:right">￥<span id="price"></span></p>
        </div>
        <div class="main">
            <div class="main_top">
                <p class="fl" style="color:#ccc;">优惠</p>
                <div class="main_r fr">
                    <p class="fl buy" style="color:#40cccc;width:90%;text-align:right;">全网低价，抢优惠卷</p>
                    <div class="main_imgs fr">
                        <img src="../image/a12.png">
                    </div>
                </div>

            </div>

            <!-- <div class="main_top">
                <p class="fl" style="color:#ccc;">内容</p>
                <div class="main_r fr">
                    <p class="fl" style="color:#ccc;width:90%;text-align:right;">未选择</p>
                    <div class="main_imgs fr">
                        <img src="../image/a11.png">
                    </div>
                </div>
            </div>
            <div class="main_top">
                <p class="fl" style="color:#ccc;">阶段</p>
                <div class="main_r fr">
                    <p class="fl" style="color:#ccc;width:90%;text-align:right;">未选择</p>
                    <div class="main_imgs fr">
                        <img src="../image/a11.png">
                    </div>
                </div>
            </div> -->
            <div class="main_top" onclick="brand()">
                <div class="main_left fl">
                    <div class="left_imgs fl">
                        <img src="../image/u53.png" alt="" id="head_url" style="width:55px;height:55px;">
                    </div>
                    <div class="ef fl">
                        <h4 id="mec"></h4>
                        <p style="color:#ccc;" id="cur_num"></p>
                    </div>
                </div>
                <div class="main_r fr">
                    <p class="fl" style="color:#ccc;width:90%;text-align:right;">进入品牌</p>
                    <div class="main_imgs fr">
                        <img src="../image/a12.png">
                    </div>
                </div>
            </div>
        </div>
        <div class="hello">
            <!-- <div class="hello_one">
                <div class="hello_left fl">
                    <div class="hello_img fl">
                        <img src="../image/a23.png" alt="">
                    </div>
                    <h5 class="fl" style="margin-left:0.5rem;">E**麦</h5>
                </div>
                <div class="hello_right fr">
                    <div class="ef fl">
                        <p style="line-height:1.5rem">英孚教育</p>
                        <p>在售课程89个</p>
                    </div>
                    <div class="go fl">
                        去参团
                    </div>
                </div>
            </div> -->
            <!-- <div class="hello_one">
                <div class="hello_left fl">
                    <div class="hello_img fl">
                        <img src="../image/a23.png" alt="">
                    </div>
                    <h5 class="fl" style="margin-left:0.5rem;">E**麦</h5>
                </div>
                <div class="hello_right fr">
                    <div class="ef fl">
                        <p style="line-height:1.5rem">英孚教育</p>
                        <p>在售课程89个</p>
                    </div>
                    <div class="go fl">
                        去参团
                    </div>
                </div>
            </div>
            <div class="hello_one">
                <div class="hello_left fl">
                    <div class="hello_img fl">
                        <img src="../image/a23.png" alt="">
                    </div>
                    <h5 class="fl" style="margin-left:0.5rem;">E**麦</h5>
                </div>
                <div class="hello_right fr">
                    <div class="ef fl">
                        <p style="line-height:1.5rem">英孚教育</p>
                        <p>在售课程89个</p>
                    </div>
                    <div class="go fl">
                        去参团
                    </div>
                </div>
            </div>
        </div>
        <!-- 拼团 -->
        <!--<div class="pin">
          <div class="main_top">
              <p class="fl">拼团玩法</p>
              <div class="main_r fr">
                  <p class="fl" style="width:90%;text-align:right;">规则说明</p>
                  <div class="main_imgs fr">
                      <img src="../image/a11.png">
                  </div>
              </div>
          </div>
            <div class="pin_rights">
                <div class="pin_imgs fl">
                    <img src="../image/u81.png" alt="">
                </div>
                <p class="fl">开团</p>
                <div class="pin_imgs fl" style="margin:0.5rem 0.2rem">
                    <img src="../image/u84.png" alt="">
                </div>
                <div class="pin_imgs fl">
                    <img src="../image/u82.png" alt="">
                </div>
                <p class="fl">邀请好友</p>
                <div class="pin_imgs fl" style="margin:0.5rem 0.2rem">
                    <img src="../image/u84.png" alt="">
                </div>
                <div class="pin_imgs fl">
                    <img src="../image/u83.png" alt="">
                </div>
                <p class="fl">成团后开课</p>
            </div>
        </div> -->
        <!--  晒图-->
        <div class="sai" >
            <h4>晒图评价</h4>
            <div id="comment"></div>
          <!-- <div class="sai_nav">
            <div class="hello_left">
                <div class="hello_imgs fl">
                    <img src="../image/a23.png" alt="">
                </div>
                <h5 class="fl" style="margin-left:0.5rem;line-height:2rem;">E**麦</h5>
            </div>
            <p style="font-size:1rem;">刚开始上课，但是孩子状态不错，联系刻骨佳佳不错，态度很好</p>
            <p style="font-size:0.9rem;color:#ccc;margin-top:0.5rem">2019-07-07</p>
          </div> -->

          <div class="sai_nav sai_navs" onclick="see_pl()">
            <p class="sai_n">查看全部<span id="pl_num">0</span>评论</p>
          </div>
        </div>
        <!-- 课程详情 -->
        <div class="kc">
          <h4>课程详情</h4>
          <div class="kc_img" id="content">
            <!-- <img src="../image/u0.jpg" alt=""> -->
          </div>

          <div class="footer" onclick="yy()">
            立即预约
          </div>
        </div>

    </div>
</body>

<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript" src="../script/jquery-1.8.3.js"></script>
<script type="text/javascript">
    var userinfo = $api.getStorage('userinfo');
    var id
    var shop_id = ''
    var pl_num = 0
    var sc
    apiready = function() {
      id = api.pageParam.id
      api.addEventListener({
          name:'user_login',
          extra:{
              threshold:0
          }
      }, function(ret, err){
              userinfo=$api.getStorage('userinfo');
              get_curj()
            //	get_user()//获取用户数据

      });

      api.addEventListener({
          name:'user_register',
          extra:{
              threshold:0
          }
      }, function(ret, err){

              userinfo=$api.getStorage('userinfo');
              get_curj()
              //get_user()//获取用户数据

      });

      api.addEventListener({
          name:'user_out',
          extra:{
              threshold:0
          }
      }, function(ret, err){
              userinfo=$api.getStorage('userinfo');
get_curj()
            //	get_user()//获取用户数据

      });

      get_list()//获取课程详情
      get_comment()//获取课程2条评论
      api.addEventListener({
          name:'pay_ok',
          extra:{
              threshold:0
          }
      }, function(ret, err){
              api.closeWin({

              });

            //	get_user()//获取用户数据

      });

      if(userinfo){
        add_foot()//添加足迹
      }



    };
    function scs() {
      api.ajax({
          url:  SITE_URL+'user_api/coupon/sc',
          method: 'post',
          data: {
              values: {
                  id: id,
                  user_id:userinfo.id,
                  sc:sc
              }
          }
      },function(ret, err){
          if (ret) {
            if(ret.error==200){
              api.sendEvent({
                  name: 'sc',

              });
              if(sc==1){
                $("#sc").attr('src','../image/u36.png')
                msgcode('取消成功')
                sc=0
              }else{
                $("#sc").attr('src','../image/aaqs.png')
                msgcode('收藏成功')
                sc=1
              }
            }else{
              msgcode('稍后再试')
            }
              //alert( JSON.stringify( ret ) );
          } else {
            msgcode('请检出网络连接')
              //alert( JSON.stringify( err ) );
          }
      });

    }
    function ljqu(id) {
      api.ajax({
          url: SITE_URL+'user_api/coupon/add_cou',
          method: 'post',
          data: {
              values: {
                  user_id: userinfo.id,
                  cou_id:id
              }
          }
      },function(ret, err){
          if (ret) {
            if(ret.error==200){
              api.sendEvent({
                  name: 'sc',

              });
              msgcode('领取成功')
              $("#lqse"+id).html('已领取')
              $("#lqse"+id).css('background-color','#C7C7C7')
              $("#lqse"+id).removeAttr('onclick')
            }else if(ret.error==300){
              msgcode('手慢了,已领完')

            }else{
              msgcode('稍后再试')
            }
              //alert( JSON.stringify( ret ) );
          } else {
            msgcode('请检查网络')
              //alert( JSON.stringify( err ) );
          }
      });

    }
    function get_curj() {
      if(!userinfo){
        return false
      }
      var html =''
      var obj = $api.byId('curj');

      api.ajax({
          url: SITE_URL+'user_api/coupon/get_cur',
          method: 'post',
          data: {
              values: {
                  user_id:userinfo.id,
                  shop_id: shop_id
              }
          }
      },function(ret, err){
          if (ret) {
            if(ret.error==200){
              if(ret.data.length>0){

                for (var i = 0; i < ret.data.length; i++) {
                  var dat = ret.data[i]
                  html +='<div class="no_noe">'
                  html +='<div class="no_img">'
                  html +='<img src="../image/a19.png" alt="">'
                  html +='</div>'
                  html +='<div class="no_text">'
                  html +='<p style="color:red;font-size:2rem;"><span style="font-size:0.9rem;">￥</span>'+dat.money+'</p>'
                  html +='<p style="color:#ccc;">'+dat.name+'</p>'
                  html +='</div>'
                  html +='<div class="no_w">'
                  html +='<input type="hidden" id="curlq'+dat.id+'" value="'+dat.renum+'">'
                  if(dat.lq==1){
                    html +='<p style="font-size:0.9rem" id="lqse'+dat.id+'" onclick="ljqu('+dat.id+')">立即领取</p>'
                  }else{
                    html +='<p style="font-size:0.9rem;background-color:#C7C7C7" id="lqse'+dat.id+'">已领取</p>'
                  }

                  html +='</div>'
                  html +='</div>'
                }
                $api.html(obj, html);

              }
            }
              //alert( JSON.stringify( ret ) );
          } else {

              //alert( JSON.stringify( err ) );
          }
      });

    }

    function add_foot(){
      api.ajax({
          url: SITE_URL+'cur_api/footprint/add_foot',
          method: 'post',
          data: {
              values: {
                  user_id: userinfo.id,
                  pid:id
              }
          }
      },function(ret, err){

      });

    }



// 去预约（暂停
    function yy() {
      if(!userinfo){
        login_at()
        return false;
      }
      api.openWin({
          name: 'quanbu_kecheng_yykc',
          url: './quanbu_kecheng_yykc.html',
          pageParam: {
              id: id
          }
      });

    }

    function see_pl() {
      if(!userinfo){
        login_at()
        return false;
      }
      api.openWin({
          name: 'pl',
          url: './pl.html',
          pageParam: {
              id: id,
              num:pl_num
          }
      });

    }

    function brand() {

        api.openWin({
            name: 'brand',
            url: './brand.html',
            pageParam: {
                        id: shop_id
                    }
        });

    }

  function get_comment() {
    var html =''
    var obj = $api.byId('comment');

    api.ajax({
        url: SITE_URL+'cur_api/comment/index',
        method: 'post',
        data: {
            values: {
                id: id
            }
        }
    },function(ret, err){
        if (ret.error==200) {
          for (var i = 0; i < ret.data.list.length; i++) {
             var dat = ret.data.list[i]
             html +='<div class="sai_nav">'
             html +='<div class="hello_left">'
             html +='<div class="hello_imgs fl">'
             html +='<img src="'+dat.head_img+'" alt="">'
             html +='</div>'
             html +='<h5 class="fl" style="margin-left:0.5rem;line-height:2rem;">'+cutstr(dat.nick_name,10)+'</h5>'
             html +='</div>'
             html +='<p style="font-size:1rem;">'+dat.say_some+'</p>'
             html +='<p style="font-size:0.9rem;color:#ccc;margin-top:0.5rem">'+gettime(dat.time)+'</p>'
             html +=' </div>'
          }
          $("#pl_num").html(ret.data.pl_num)
          pl_num = ret.data.pl_num
          $(obj).prepend(html)
          }else{

          }//暂无评论
            //alert( JSON.stringify( ret ) );

    });

  }



    function get_list() {
      var html =''
      var obj = $api.byId('img_list');

      api.ajax({
          url: SITE_URL+'cur_api/cur/get_curlist',
          method: 'post',
          data: {
              values: {
                  id: id
              }
          }
      },function(ret, err){
          if (ret) {
            if(ret.error==200){
              $("#cur_name").html(ret.data.cur_name)
              $("#mec_name").html(ret.data.mec_name)
              $("#mec").html(ret.data.mec_name)
              $("#cur_num").html('在售课程'+ret.data.cur_num+'个')
              $("#orig_price").html(ret.data.orig_price)
              $("#price").html(ret.data.price)
              $("#head_url").attr('src',ret.data.head_url)
              $("#content").html(ret.data.content)
              if(ret.data.sc==1){//已收藏
                $("#sc").attr('src','../image/aaqs.png')
              }else{//未收藏
                $("#sc").attr('src','../image/u36.png')
              }

              sc = ret.data.sc
              shop_id = ret.data.shop_id
              console.log('shop_id:' + shop_id);
              if(ret.data.videos!='undefined' && ret.data.videos!=null && ret.data.videos!=''){
                var htmls = ''
                htmls +='<div class="swiper-slide">'
                htmls +='<video poster="'+ret.data.img_url+'" src="'+ret.data.videos+'" width="100%" height="100%" controls >'
                htmls +='</video>'
                htmls +='</div>'
                $api.append(obj, htmls);

              }
        //      alert(ret.data.videos)


              if(ret.data.img_list){
                for (var i = 0; i < ret.data.img_list.length; i++) {
                  var dat = ret.data.img_list[i]
                  html +='<div class="swiper-slide"><img src="'+dat+'" width="100%" height="100%"></div>'
                }
                $api.append(obj, html);

              }

              var mySwiper = new Swiper ('.swiper-container', {
                // autoplay:true,
                loop : true,
              })
              if(ret.data.type==1){
                $("#cur_type").html('在线直播课程')
              }else if(ret.data.type==2){
                $("#cur_type").html('在线视频课程')
              }else{
                $("#cur_type").html('上课地址:'+ret.data.address)
                alert('此课程为线下课程,需要您到'+ret.data.address+'进行上课')

              }
              get_curj()
            }else{
              msgcode('稍后再试')
            }
              //alert( JSON.stringify( ret ) );
          } else {
            msgcode('请检查网络链接')
              //alert( JSON.stringify( err ) );
          }
      });

    }
</script>

</html>
